package com.nuoniu.sibanyun.entity.production;

import java.math.BigDecimal;
import java.time.LocalDate;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 生产加工单——工序明细
 * </p>
 *
 * @author 白强
 * @since 2021-04-03
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ma_written_instruction_process_detail")
@ApiModel(value="VProductionWorkProcedureDetail对象", description="生产加工单——工序明细")
public class VProductionWorkProcedureDetail extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "租户ID")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套ID")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "加工单ID")
    @TableField("production_work_main_id")
    private Integer productionWorkMainId;

    @ApiModelProperty(value = "加工单_明细ID")
    @TableField("production_work_detail_id")
    private Integer productionWorkDetailId;

//    @ApiModelProperty(value = "派工单ID -- 废弃")
//    @TableField("production_dispatch_id")
//    private Integer productionDispatchId;
//
//    @ApiModelProperty(value = "派工单号 -- 废弃")
//    @TableField("production_dispatch_code")
//    private String productionDispatchCode;

    @ApiModelProperty(value = "主产品ID")
    @TableField("parent_inventory_id")
    private Integer parentInventoryId;

    @ApiModelProperty(value = "工艺路线_工序明细ID")
    @TableField("process_route_detail_id")
    private Integer processRouteDetailId;

    @ApiModelProperty(value = "工序ID")
    @TableField("procedure_id")
    private Integer procedureId;

    @ApiModelProperty(value = "工序名称")
    @TableField("procedure_name")
    private String procedureName;

    @ApiModelProperty(value = "工序标识1:首工序2:尾工序3:中间工序")
    @TableField("work_flag")
    private Integer workFlag;

    @ApiModelProperty(value = "上一个工序ID")
    @TableField("last_procedure_id")
    private Integer lastProcedureId;

    @ApiModelProperty(value = "上一个工序名称")
    @TableField("last_procedure_name")
    private String lastProcedureName;

    @ApiModelProperty(value = "班组ID")
    @TableField("team_id")
    private Integer teamId;

    @ApiModelProperty(value = "班组名称")
    @TableField("team_name")
    private String teamName;

    @ApiModelProperty(value = "工人ID")
    @TableField("worker_id")
    private Integer workerId;

    @ApiModelProperty(value = "工人姓名")
    @TableField("worker_name")
    private String workerName;

    @ApiModelProperty(value = "工人工号（工人编码）")
    @TableField("worker_no")
    private String workerNo;

    @ApiModelProperty(value = "生产设备")
    @TableField("equipment_name")
    private String equipmentName;


    @ApiModelProperty(value = "主计量（主单位）")
    @TableField("base_unit")
    private String baseUnit;

    @ApiModelProperty(value = "主计量名称")
    @TableField("base_unit_name")
    private String baseUnitName;

    @ApiModelProperty(value = "工价（主单位）")
    @TableField("labour_cost")
    private BigDecimal labourCost;

    @ApiModelProperty(value = "标准合格率（%）")
    @TableField("sta_pass_rate")
    private BigDecimal staPassRate;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;


    @ApiModelProperty(value = "累计合格数量")
    @TableField("cum_qualified_quantity")
    private BigDecimal cumQualifiedQuantity = BigDecimal.ZERO;

    @ApiModelProperty(value = "累计不合格数量")
    @TableField("cum_unqualified_quantity")
    private BigDecimal cumUnqualifiedQuantity = BigDecimal.ZERO;

    @ApiModelProperty(value = "累计返工数量")
    @TableField("cum_rework_quantity")
    private BigDecimal cumReworkQuantity = BigDecimal.ZERO;

    @ApiModelProperty(value = "累计报废数量")
    @TableField("cum_scrap_quantity")
    private BigDecimal cumScrapQuantity = BigDecimal.ZERO;


    @ApiModelProperty(value = "实时合格率（%）")
    @TableField("pass_rate")
    private BigDecimal passRate;

    @ApiModelProperty(value = "累计执行数量")
    @TableField(exist = false)
    private BigDecimal cumExecuteQuantity;

    @ApiModelProperty(value = "自定义字段数据")
    @TableField("define_fields")
    private String defineFields;

    @ApiModelProperty(value = "开工日期")
    @TableField("start_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate startDate;

    @ApiModelProperty(value = "完工日期")
    @TableField("finish_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate finishDate;

    @ApiModelProperty(value = "状态(0:进行中 1:中止 10：完工)")
    @TableField("status")
    private Integer status;


}
